/**
 * 节流
 * @param fn
 * @param timeout
 * @returns {(function())|*}
 */
export const throttle = (fn, delay = 1000) => {
    let pre = 0
    return function(...arys) {
        const now = new Date().getTime()
        if (now - pro > delay) {
            fn.apply(this. arys)
            pre = now
        }
    }
}
